﻿<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="Ribbon.Library.Actions.Scripts"
              Location="ScriptLink"
              ScriptSrc="/_layouts/SPRA/CopyItem.js" />
  
  <CustomAction Id="{b204e0c2-685d-450b-9450-fdb4ab9e3c5c}" Location="CommandUI.Ribbon.ListView" RegistrationId="100" RegistrationType="List" Sequence="100" Rights="EditListItems" xmlns="http://schemas.microsoft.com/sharepoint/">
    <CommandUIExtension xmlns="http://schemas.microsoft.com/sharepoint/">
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
          <Button Id="{ac5bc1a8-6b23-4bdf-be7a-fa7a601e15c8}"
                  Command="{9637008c-f86a-49d6-bbc7-cf331dbb7fac}"
                  Image32by32="/_layouts/Images/SPRA/CopyItem_32x32.png"
                  Image16by16="/_layouts/Images/SPRA/CopyItem_32x32.png"
                  Sequence="100"
                  LabelText="Copy Item"
                  Description="Copy Item perserving field values"
                  TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
          Command="{9637008c-f86a-49d6-bbc7-cf331dbb7fac}"
          CommandAction="javascript:SPRACopyItemShowDialog('{SiteUrl}','{ItemId}','{ListId}',escape(window.location));"
          EnabledScript="javascript:SPRACopyItemEnable();"/>
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
  
  <CustomAction Id="{b204e0c2-685d-450b-9450-fdb4ab9e3c5c}"
                Location="CommandUI.Ribbon.DisplayForm"
                Rights="EditListItems"
                RegistrationId="100"
                RegistrationType="List"
                xmlns="http://schemas.microsoft.com/sharepoint/">
    <CommandUIExtension xmlns="http://schemas.microsoft.com/sharepoint/">
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.ListForm.Display.Manage.Controls._children">
          <Button Id="{6f82835d-b77a-427e-a616-a42e35890be4}"
                  Command="{4dbbd280-552c-4eed-9168-63a5d92248bc}"
                  Image32by32="/_layouts/Images/SPRA/CopyItem_32x32.png"
                  Image16by16="/_layouts/Images/SPRA/CopyItem_32x32.png"
                  Sequence="11"
                  LabelText="Copy Item"
                  TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
          Command="{4dbbd280-552c-4eed-9168-63a5d92248bc}"
          CommandAction="javascript:SPRACopyItemShowDialog('{SiteUrl}','{ItemId}','{ListId}','{Source}');" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>